# views.py

import pdb

from django.shortcuts import render_to_response
from django.contrib.admin.views.decorators import staff_member_required

from psd.register.models import Person, RegRecord, LOCATIONS

@staff_member_required
def check_in(request):
    if request.method == 'POST':
        id_list = request.POST.getlist('here')
        RegRecord.objects.filter(id__in=id_list).update(here=True)

        id_list = request.POST.getlist('paid')
        RegRecord.objects.filter(id__in=id_list).update(paid=True)

        id_list = request.POST.getlist('cancelled')
        RegRecord.objects.filter(id__in=id_list).update(cancelled=True)

    regs = RegRecord.objects.order_by('nickname')
    return render_to_response('checkin.html', {'regs': regs})
